home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung CD 2 (Tewi)(1994).iso
/
c
/
compiler
/
small_c
/
byte_sc
/
atoi.c
< prev
next >
Wrap
Text File
|
1987-10-04
|
384b
|
17 lines
#define NOCCARGC /* no argument count passing */
/*
** atoi(s) - convert s to integer.
*/
atoi(s) char *s; {
int sign, n;
while(isspace(*s)) ++s;
sign = 1;
switch(*s) {
case '-': sign = -1;
case '+': ++s;
}
n = 0;
while(isdigit(*s)) n = 10 * n + *s++ - '0';
return (sign * n);
}